<template>
	<view class="main">
		<u-navbar :is-back="true" title="历史缴费" :background="background" title-size="32" title-color="#000"  :border-bottom="false" ></u-navbar>
		<view class="record" v-for="(item,index) in list" :key="index">
			<view class="top">
				<text>{{item.paymentMonth}}</text>
				<view>缴费金额：{{item.feeAmount}}</view>
			</view>
			<view class="user">
				{{item.buildInfo}} . 业主：{{info.user.nickName}}
			</view>
		</view>
	</view>
</template>
<script>
	export default {
		data() {
			return {
				list: [],
				info:''
			}
		},
		onLoad() {
			this.record()
			this.getuserinfo()
		},
		onShow() {},
		methods: {
			record() {
				global.$http.request({
					url: '/business/property/getListByLogin',
					method: 'GET',
					header: {
						'Authorization': uni.getStorageSync('token') //自定义请求头信息
					},
					data: {
						pageNum: 1,
						pageSize: 10
					}
				}).then(res => {
					if (res.data.code == 200) {
						console.log(res.data);
						this.list = res.data.data
					}
				})
			},
			getuserinfo() {
				global.$http.request({
					url: '/getInfo',
					method: 'GET',
					header: {
						'Authorization': uni.getStorageSync('token') //自定义请求头信息
					},
				}).then(res => {
					if (res.data.code == 200) {
						console.log(res.data);
						this.info = res.data
					}
				})
			},

		}
	}
</script>

<style lang="scss">
	page {
		background-color: #f7f7f7;
		font-family: Source Han Sans CN;

		.main {
			width: 750rpx;

			.record {
				margin: 10rpx 0;
				background-color: #fff;
				padding: 30rpx 31rpx 38rpx 36rpx;

				.top {
					display: flex;
					align-items: center;
					justify-content: space-between;

					text {
						font-size: 28rpx;
						font-weight: 400;
						color: #074D93;
					}

					view {
						font-size: 28rpx;
						font-weight: 500;
						color: #000000;
					}
				}

				.user {
					padding-top: 28rpx;
					font-size: 28rpx;
					font-family: PingFang SC;
					font-weight: 400;
					color: #000000;
				}
			}
		}
	}
</style>
